<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

function sort_array($array, $field)
{
	if (!is_array($array))
	{
		return FALSE;
	}
	
	function compare($a, $b)
	{
		return ($a[FIELD] < $b[FIELD]) ? -1 : 1;
	}

	define('FIELD', $field);
	uasort($array, 'compare');
	return $array;
}